home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 20
/
CU Amiga Magazine's Super CD-ROM 20 (1998)(EMAP Images)(GB)[!][issue 1998-03].iso
/
CDsupport
/
IDer
/
Routines
/
ProcessSuffix.s
< prev
next >
Wrap
Text File
|
1997-02-18
|
964b
|
31 lines
ProcessSuffix: Move.L _Suffix(PC),A0 ;was the SUFFIX entry included for this class
Cmp.L #0,A0
Beq.S .NoSuffix
Lea WorkData,A1
Move.W #'#?',(A1)+ ;add the wildcard to allow for anything before the suffix
Bsr StripQuotes ;copy the string, and remove any "'s while go.
Move.L #WorkData,D1
Move.L #ParseData,D2
Move.L #255,D3
CALL ParsePatternNoCase,DOS ;we need to "tokinize" the wildcards
Cmp.L #-1,D0 ;-1 is something went wrong with the string
Beq.S .BadSuffix
Move.L #ParseData,D1
Move.L _FilePart(PC),D2
CALL MatchPatternNoCase ;try and match the suffix with the filename (taking into account the wildcard)
Tst.L D0
Beq.S .BadSuffix
Addq.B #1,_Successful ;mark that the check was correct
Cmp.B #MODE_ONE,_Mode ;are we running in OR mode
Beq LaunchAction ;if so, then run the ACTION command now
Bra.S .NoSuffix
.BadSuffix Cmp.B #MODE_ALL,_Mode ;are we running in OR mode
Beq CheckLoop ;if not, then abort the search
.NoSuffix